package fab.locale 
{
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	
	public class Localisation
	{
		static private var _callback:Function;
		static public var xmlFile:XML;
		
		static public function load( url:String, callback:Function ) :void
		{
			_callback = callback;
			var urlloader:URLLoader = new URLLoader();
			urlloader.addEventListener( Event.COMPLETE, load_xml );
			urlloader.load( new URLRequest( url ) );
		}
		static private function load_xml(e:Event):void 
		{
			xmlFile = new XML( ( e.currentTarget as URLLoader).data );
			_callback();
		}
	}
}